<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<div id="editer" contentEditable="true" style="border:1px solid #ccc;width:400px;height:200px" >
    123456<br/>123456
</div>
<button onclick="InsertImage()">InsertImage</button>
<script language="javascript">

    var editer=document.getElementById('editer');
    function InsertImage(){
        ImagePath = window.prompt('图片URL:', '');
        editer.focus();
        document.execCommand('InsertImage', false, ImagePath);
    }

    </script>
</body>
</html>